Skip to content

Conversation

@HulonJenkins
Copy link
Contributor

No description provided.

@prmerger-automator
Copy link
Contributor

@HulonJenkins : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change.

@learn-build-service-prod
Copy link
Contributor

Learn Build status updates of commit b020f17:

⚠️ Validation status: warnings

File Status Preview URL Details
docs/cpp/preservenone.md ⚠️Warning Details
docs/cpp/argument-passing-and-naming-conventions.md ✅Succeeded

docs/cpp/preservenone.md

  • Line 1, Column 1: [Warning: title-missing - See documentation] Missing required attribute: 'title'. Add a title string to show in search engine results.
  • Line 68, Column 1: [Warning: file-not-found - See documentation] Invalid file link: 'argument-passing-and-naming-conventions'.
  • Line 69, Column 1: [Warning: file-not-found - See documentation] Invalid file link: '../build/x64-calling-convention'.
  • Line 70, Column 1: [Warning: file-not-found - See documentation] Invalid file link: 'keywords-cpp'.
  • Line 1, Column 1: [Suggestion: description-missing - See documentation] Missing required attribute: 'description'.
  • Line 68, Column 1: [Suggestion: preserve-view-not-set - See documentation] You've pinned this link to a specific version of content with the view parameter. It's recommended not to pin a version unless that version is A) not the default view and B) the context is about that version specifically. To proceed with pinning a version add the &preserve-view=true to the URL. Otherwise, remove the view parameter. URL: argument-passing-and-naming-conventions?view=msvc-170
  • Line 69, Column 1: [Suggestion: preserve-view-not-set - See documentation] You've pinned this link to a specific version of content with the view parameter. It's recommended not to pin a version unless that version is A) not the default view and B) the context is about that version specifically. To proceed with pinning a version add the &preserve-view=true to the URL. Otherwise, remove the view parameter. URL: ../build/x64-calling-convention?view=msvc-170
  • Line 70, Column 1: [Suggestion: preserve-view-not-set - See documentation] You've pinned this link to a specific version of content with the view parameter. It's recommended not to pin a version unless that version is A) not the default view and B) the context is about that version specifically. To proceed with pinning a version add the &preserve-view=true to the URL. Otherwise, remove the view parameter. URL: keywords-cpp?view=msvc-170

For more details, please refer to the build report.

Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.

@v-regandowner
Copy link
Contributor

@HulonJenkins - Microsoft authors and contributors need to make content contributions through the private repository so the content can be staged and validated by the current validation rules.

After you make your changes in the private repo, review the articles on staging, and fix any validation issues, you can add the sign-off comment to let PR reviewers know that the updates are ready to be merged.

Read about authors working in the public repo for more information.

If you need help getting set up to work in the private repo, see Get started contributing to the Microsoft Learn platform.

We'll close this PR. Thank you.

Copy link
Collaborator

@TylerMSFT TylerMSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments for your consideration.

**Microsoft Specific**

> [!IMPORTANT]
> The **`__preserve_none`** calling convention is experimental and subject to change in future releases. Use at your own risk.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove "use at your own risk"

|[__fastcall](../cpp/fastcall.md)|Callee|Stored in registers, then pushed on stack|
|[__thiscall](../cpp/thiscall.md)|Callee|Pushed on stack; **`this`** pointer stored in ECX|
|[__vectorcall](../cpp/vectorcall.md)|Callee|Stored in registers, then pushed on stack in reverse order (right to left)|
|[__preserve_none](../cpp/preservenone.md)|Callee|Stored in registers only|
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also needs to be added to ./toc.yml

| Element | Implementation |
|---------|----------------|
| Argument-passing order | Arguments are passed in up to 10 registers in the following order: r13, r14, r15, rbx, rsi, rdi, r9, r8, rdx, rcx. If a hidden parameter is required for struct returns, it is passed in r13 (the first parameter register), reducing available parameter registers to 9. Registers r10-r12 are reserved for various CRT and Windows runtimes. All parameters must be passed through registers; stack-based parameters are not currently supported. |
| Register allocation strategy | Registers rcx, rdx, r8, and r9 are allocated towards the end and in reverse order to reduce register spilling. |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does "towards the end" mean? Combine that with "in reverse" order and it gets confusing. Maybe an example?

| Volatile registers | All general-purpose registers except rsp (stack pointer) and rbp (base pointer) are treated as volatile and do not need to be preserved across function calls. While r10 and r11 are volatile, they are not used for parameter passing to maintain compatibility with existing programs. |
| Nonvolatile registers | Only rsp, rbp, and r12 are nonvolatile. |
| Stack alignment | The stack must maintain 16-byte alignment. |
| Frame pointer | The rbp register and frame chain follow the /Gy switch settings. |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you link to the /Gy topic.

| Stack alignment | The stack must maintain 16-byte alignment. |
| Frame pointer | The rbp register and frame chain follow the /Gy switch settings. |
| Stack-maintenance responsibility | The callee is responsible for cleaning up its own stack space. |
| Shadow space | A 32-byte shadow space is reserved on the stack to maintain compatibility with profilers and debugging tools. |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth a sentence to describe what shadow space is?

| Frame pointer | The rbp register and frame chain follow the /Gy switch settings. |
| Stack-maintenance responsibility | The callee is responsible for cleaning up its own stack space. |
| Shadow space | A 32-byte shadow space is reserved on the stack to maintain compatibility with profilers and debugging tools. |
| Floating-point support | Floating-point parameters are not supported in the current version. |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't say "in the current version" because some construe it to mean "but it's coming in the next". It's a legal thing so we avoid it.

The **`__preserve_none`** calling convention has the following restrictions:

- **C only**: Only supported for C programs.
- **x64 only**: Only the x64 backend provides support for this calling convention.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we say this without mentioning the backend? Something like "This calling convention is only supported for X64 code generation" or something like that.


## See also

[Argument Passing and Naming Conventions](argument-passing-and-naming-conventions?view=msvc-170)
Copy link
Collaborator

@TylerMSFT TylerMSFT Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These will run together on the same line on the live site. Add \ to the end of all but the last one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants